`parse.rule` <-
function(rule) {
	# Get rule result.
	cl = rule[1]
	
	# Get rule conditions.
	cond = list()
	
	# Fill in conditions list.
	for(i in 2:length(rule)) {
		if(length(grep("< ", rule[i]))) {
			cond[[i-1]] = c(unlist(strsplit(as.character(rule[i]), "< "))[1],
					  "< ",
					  unlist(strsplit(as.character(rule[i]), "< "))[2]) 
		}
		else if(length(grep(">=", rule[i]))) {
			cond[[i-1]] = c(unlist(strsplit(as.character(rule[i]), ">="))[1],
					  ">=",
					  unlist(strsplit(as.character(rule[i]), ">="))[2])
		}
		else if(length(grep("=", rule[i]))) {
			cond[[i-1]] = c(unlist(strsplit(as.character(rule[i]), "="))[1],
					  "=",
					  unlist(strsplit(as.character(rule[i]), "="))[2])
			cond[[i-1]] = unlist(strsplit(cond[[i-1]], ","))
		}
		else {
			cat("parse.rule ERROR: no condition found!\n")
		}
	}
	ans = c()
	ans$class <- cl
	ans$condition <- cond
	return(ans)
}

